<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div th:replace="~{common/head::head}"></div>
<div class="right">
    <div class="location">
        <strong>当前位置:</strong>
        <span>用户管理页面</span>
    </div>
    <div class="search">
        <form method="get" action="/sys/user/list">
            <span>用户名：</span>
            <input name="queryRealName" class="input-text"	type="text" th:value="${queryRealName}">

            <span>角色：</span>
            <select name="queryRoleId">
                <option value="">--全部--</option>
                <option th:each="role : ${roleList}"
                        th:value="${role.id}"
                        th:text="${role.roleName}"
                        th:selected="${role.id == queryRoleId}">
                </option>
                <!--<c:if test="${roleList != null }">
                    <option value="">&#45;&#45;全部&#45;&#45;</option>
                    <c:forEach var="role" items="${roleList}">
                        <option <c:if test="${role.id == queryRoleId }">selected="selected"</c:if>
                        value="${role.id}">${role.roleName}</option>
                    </c:forEach>
                </c:if>-->
            </select>

            <input type="hidden" name="pageIndex" value="1"/>
            <input	value="查 询" type="submit" id="searchbutton">
            <a href="/sys/user/toAdd">添加</a>
        </form>
    </div>
    <!--用户-->
    <table class="supplierTable" cellpadding="0" cellspacing="0">
        <tr class="firstTr">
            <th width="15%">账号</th>
            <th width="15%">真实姓名</th>
            <th width="10%">角色</th>
            <th width="10%">性别</th>
            <th width="10%">年龄</th>
            <th width="10%">电话</th>
            <th width="30%">操作</th>
        </tr>
        <tr th:each="user, status : ${userList}">
            <td th:text="${user.account}">[[${user.account}]]</td>
            <td th:text="${user.realName}">[[${user.realName}]]</td>
            <td th:text="${user.roleIdName}">[[${user.roleIdName}]]</td>
            <td>
                <span th:if="${user.sex==1}">女</span>
                <span th:if="${user.sex==2}">男</span>
            </td>
            <td th:text="${user.age}">[[${user.age}]]</td>
            <td th:text="${user.phone}">[[${user.phone}]]</td>
            <td>
                <a class="viewUser" href="javascript:;" th:userid="${user.id}" th:account="${user.account}">
                    <img th:src="@{/images/view.png}" alt="查看" title="查看"/>
                </a>
                <a class="modifyUser" href="javascript:;" th:userid="${user.id}" th:account="${user.account}">
                    <img th:src="@{/images/upd.png}" alt="修改" title="修改"/>
                </a>
                <a class="deleteUser" href="javascript:;" th:userid="${user.id}" th:account="${user.account}">
                    <img th:src="@{/images/del.png}" alt="删除" title="删除"/>
                </a>
            </td>
        </tr>
     <!--   <c:forEach var="user" items="${userList }" varStatus="status">
            <tr>
                <td>
                    <span>${user.account }</span>
                </td>
                <td>
                    <span>${user.realName }</span>
                </td>
                <td>
                    <span>${user.roleIdName}</span>
                </td>
                <td>
							<span>
								<c:if test="${user.sex==1}">女</c:if>
								<c:if test="${user.sex==2}">男</c:if>
							</span>
                </td>
                <td>
                    <span>${user.age}</span>
                </td>
                <td>
                    <span>${user.phone}</span>
                </td>
                <td>
                    <span><a class="viewUser" href="javascript:;" userid=${user.id } account=${user.account }><img src="${pageContext.request.contextPath }/statics/images/view.png" alt="查看" title="查看"/></a></span>
                    <span><a class="modifyUser" href="javascript:;" userid=${user.id } account=${user.account }><img src="${pageContext.request.contextPath }/statics/images/upd.png" alt="修改" title="修改"/></a></span>
                    <span><a class="deleteUser" href="javascript:;" userid=${user.id } account=${user.account }><img src="${pageContext.request.contextPath }/statics/images/del.png" alt="删除" title="删除"/></a></span>
                </td>
            </tr>
        </c:forEach>-->
    </table>
    <!-- 隐藏输入字段 -->
    <input type="hidden" id="totalPageCount" th:value="${totalPageCount}"/>

    <!-- 引入其他模板并传递参数 -->
    <div th:insert="~{sysRole/rollpage :: rollpageFragment(totalCount=${totalCount}, currentPageNo=${currentPageNo}, totalPageCount=${totalPageCount})}"></div>

    <!--<c:import url="/WEB-INF/jsp/sysRole/rollpage.jsp">
        <c:param name="totalCount" value="${totalCount}"/>
        <c:param name="currentPageNo" value="${currentPageNo}"/>
        <c:param name="totalPageCount" value="${totalPageCount}"/>
    </c:import>-->
    <!--点击删除按钮后弹出的页面-->
    <div class="zhezhao"></div>
    <div class="remove" id="removeUse">
        <div class="removerChid">
            <h2>提示</h2>
            <div class="removeMain">
                <p>确定删除该用户吗？</p>
                <a href="#" id="yes">是</a>
                <a href="#" id="no">否</a>
            </div>
        </div>
    </div>
</div>
</section>
</div>

<div th:replace="~{common/foot::foot}"></div>
    <script type="text/javascript" th:src="@{/js/sysUser/list.js}"></script>

</body>
</html>